<template>
  <div class="container-wrap">
    <mainView :userName="loginName" :passWord="passWord"></mainView>
    <gisBkg/>
  </div>
</template>

<script  >
import gisBkg from '../components/gisBkg/index.vue';
import mainView from '../components/mainView/index.vue';
import {useRouter} from 'vue-router'
import {defineComponent, onMounted,reactive,provide} from "vue";
export default defineComponent({
  name:'Home',
  components:{gisBkg,mainView},
  setup(){
    const loginName = localStorage.getItem("loginName");
    const passWord = localStorage.getItem("passWord");
    const router = useRouter();
      const userData=reactive({
        username:loginName,
        password:passWord
    })
    provide("userData",userData);
    onMounted(()=>{
      if (!sessionStorage.getItem('loginName') || !localStorage.getItem('loginName')) {
        localStorage.clear()
        router.push({
          name: "landpointtc",
        })
      }
    })
    return{
      router,
      loginName,
      passWord
    }
  }
})


</script>

<style lang="scss" scoped>
.container-wrap {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background-color: #000000;
}
</style>
